package com.sbl.bajw.common;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sbl.bajw.common.web.MessageException;
import com.sbl.bajw.pc.service.PrivilegeService;

@Service
public class PrivilegeUtil {
	
	@Resource
	PrivilegeService pService;
	
	static PrivilegeUtil instance;
	
	public static PrivilegeUtil GetInstance(){
		return instance;
	}
	
	public static void setInstance(PrivilegeUtil instance) {
		PrivilegeUtil.instance = instance;
	}
	
	public void init(){
		PrivilegeUtil.instance = this;
	}

	public void PrivilegeService() throws MessageException{
		throw new MessageException("我被初始化了");
	}
	
	public boolean hasPrivilege(String key){
		boolean result = pService.hasPrivilege(key);
		return result;
	}
	
}
